package me;

import java.lang.reflect.Proxy;

import p1.TraceHandler;

public class TestIt {

	
	
	public static void main(String[] args) throws ClassNotFoundException {
		Object bean = new CheckNameImp();
	//	Class.forName("me.CheckName");
		ClassLoader cl = bean.getClass().getClassLoader();
//		cl.loadClass("me.CheckName");
		CheckName c = (CheckName)Proxy.newProxyInstance(cl, new Class[]{CheckName.class}, new MyHandler(bean));
		
		c.check("haha");
		
		Integer i = 10;
		Class[] fs = i.getClass().getInterfaces();
		Object  o  = Proxy.newProxyInstance(cl, fs, new TraceHandler(i));
		
		System.out.println(o.equals(10));
	}

}


